﻿using RBACProject.Application.User.Dto;
using RBACProject.Domian;
using RBACProject.Repositories;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace RBACProject.Application.User
{
    /// <summary>
    /// 用户服务层-接口
    /// </summary>
    public interface IUserService
    {
        
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<int>> UserRegister(UserModel model);

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ResultDto<UserModelDto>> GetUserLogin(UserLoginDto dto);

        /// <summary>
        /// 通过用户编号查询用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<UserModel> UserQueryById(int id);


        /// <summary>
        /// 获取全部用户信息并分页
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="totalCount">总行数</param>
        /// <param name="pageCount">分页总数</param>
        /// <returns></returns>
        List<UserModel> GetUserInfo(string userName, string fullName, int pageIndex, int pageSize, out int totalCount, out int pageCount);


        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        Task<ResultDto<int>> DeleteAsync(int id);

        /// <summary>
        /// 批量删除用户信息
        /// </summary>
        /// <param name="ids">编号</param>
        /// <returns></returns>
        Task<ResultDto<int>> BatchDelUser(List<int> ids);


        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="model">参数</param>
        /// <returns></returns>
        Task<ResultDto<UserModel>> UpdateUser(UserModel model);

        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="newPassword">新密码</param>
        /// <param name="id">用户id</param>
        /// <returns></returns>
        Task<ResultDto<UserModel>> ResetUserPassword(string newPassword, int id);
    }
}